package com.aidem.onecartoon.config;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 全局controller异常处理
 *
 * @author aidem
 * @date 2020-10-28 16:31
 */
@ControllerAdvice
public class GlobalExceptionHandler {

    /**
     * 全局处理Exception异常
     * @param e
     * @return
     */
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public String handleException(Exception e) {
        e.printStackTrace();
        return "error";
    }

}
